package com.example.design.flow.test.test02Exception;

import com.example.design.flow.node.FlowNode;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ThrowExceptionNode extends FlowNode<String> {

    @Override
    public void process(String s) {
        log.info("异常节点....");
        // 模拟任务发生异常
        int i = 1 / 0;
    }

    @Override
    public void success(String s) {
        super.success(s);
    }

    @Override
    public void rollback(String s, Exception e) {
        log.info("回滚账本...");
    }

    @Override
    public void callback(String s, Exception e) {
        super.callback(s, e);
    }
}
